<?php
use_stylesheets_for_form($form);
use_javascripts_for_form($form);
/* use_stylesheet('/sfJqueryReloadedPlugin/css/ui-lightness/jquery-ui-1.8.2.custom.css');
  use_helper('jQuery');
  jq_add_plugins_by_name(array('ui')); */
use_stylesheet('/JSCal2/src/css/jscal2.css');
use_stylesheet('/JSCal2/src/css/border-radius.css');
//use_stylesheet('/JSCal2/src/css/gold/gold.css');
use_stylesheet('/JSCal2/src/css/steel/steel.css');
use_javascript('/JSCal2/src/js/jscal2.js');
use_javascript('/JSCal2/src/js/lang/es.js');
?>
<form action="<?php echo url_for('actividad/' . ($form->getObject()->isNew() ? 'create' : 'update') . (!$form->getObject()->isNew() ? '?id=' . $form->getObject()->getId() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
  <?php if (!$form->getObject()->isNew()): ?><input type="hidden" name="sf_method" value="put"/><?php endif; ?>
  <table>
    <tfoot>
      <tr>
        <td colspan="2">
          <?php echo $form->renderHiddenFields(false) ?>
          &nbsp;<?php echo button_to('Cancelar', 'actividad/index')?>
          <?php if (!$form->getObject()->isNew()): ?>
            &nbsp;<?php echo link_to('Eliminar', 'actividad/delete?id=' . $form->getObject()->getId(), array('method' => 'delete', 'confirm' => 'Are you sure?')) ?>
          <?php endif; ?>
          <input type="submit" value="Guardar" />
        </td>
      </tr>
    </tfoot>
    <tbody><?php echo $form ?></tbody>
  </table>
</form>
<script type="text/javascript">//<![CDATA[
  var cal1 = Calendar.setup({
    onSelect: function(cal) { cal.hide() },
    showTime: true
  });
  var cal2 = Calendar.setup({
    onSelect: function(cal) { cal.hide() },
    showTime: true
  });
  cal1.manageFields("actividad_inicio", "actividad_inicio", "%Y-%m-%d %H:%M");
  cal2.manageFields("actividad_fin", "actividad_fin", "%Y-%m-%d %H:%M");
  //]]>
</script>